package com.tuniu.agents.message;

import reactor.core.publisher.Flux;

public interface MessageSender {

    /**
     * Sends a message to the specified connection ID.
     * 
     * @param conId the connection ID
     * @param message the message to send
     */
    void send(String conId, String message);

    /**
     * Sends a response message to the specified connection ID with a response ID.
     * 
     * @param conId the connection ID
     * @param respId the response ID
     * @param message the message to send
     */
    void send(String conId, String respId, String message);

    /**
     * Sends a StreamMessage to the specified connection ID.
     * 
     * @param conId the connection ID
     * @param message the StreamMessage to send
     */
    void send(String conId, StreamMessage message);

    /**
     * Sends a StreamMessage to the specified connection ID with a response ID.
     * 
     * @param conId the connection ID
     * @param respId the response ID
     * @param message the StreamMessage to send
     */
    void send(String conId, String respId, StreamMessage message);

    /**
     * Sends a Flux of messages to the specified connection ID.
     * 
     * @param conId the connection ID
     * @param message the Flux of messages to send
     */
    void send(String conId, Flux<String> message);

    /**
     * Sends a Flux of messages to the specified connection ID with a response ID.
     * 
     * @param conId the connection ID
     * @param respId the response ID
     * @param message the Flux of messages to send
     */
    void send(String conId, String respId, Flux<String> message);

    // todo Remove this method in the future
    String getGlobalVariable(int type);
}
